/*
 * @Author: 张小平
 * @Date:   2025-05-01
 * @Email:  qqshuqian@163.com
 * @Copyright © 2024 aseyun. All rights reserved.
 */
import website  from '@/framework-core/config/website';

export const tableOption = {
  "border": true,
  "index": true,
  "indexLabel": "#",
  "stripe": true,
  "menuAlign": "center",
  "align": "center",
    grid: window.isMobile,
    gridSpan: 24,
  "searchMenuSpan": 6,
    searchEnter:true,
  "column": [
      {
          "type": "select",
          "label": "栏位",
          "prop": "groupId",
          "rules": [{
              required: true,
              message: '栏位不能为空',
              trigger: 'blur'
          }],
          'search': true,
          "span": 12
      }
      ,

        {
      "type": "input",
      "label": "标题",
      "prop": "title",
        "rules": [{
            required: true,
            message: '标题不能为空',
            trigger: 'blur'
        }],
        'search': true,
      "span": 12
    },


        {
      "type": "switch",
      "label": "发布状态",
      "prop": "status",
        "rules": [{
            required: true,
            message: '发布状态',
            trigger: 'blur'
        }],
            dicData: [ {
                label: '未发布',
                value: 0
            },{
                label: '已发布',
                value: 1
            }],
            value:1,
        'search': true,
      "span": 12
    }


            ,
      {
          "type": "switch",
          "label": "是否通知",
          "prop": "sftz",
          "rules": [{
              required: true,
              message: '是否通知',
              trigger: 'blur'
          }],
          dicData: [{
              label: '不通知',
              value: 0
          },{
              label: '通知',
              value: 1
          } ],
          value: 0,
          "span": 12
      }


            ,
      {
          "type": "switch",
          "label": "是否置顶",
          "prop": "sfzd",
          "rules": [{
              required: true,
              message: '是否置顶 ',
              trigger: 'blur'
          }],
          dicData: [{
              label: '否',
              value: 0
          },{
              label: '是',
              value: 1
          } ],
          'search': true,
          "span": 12
      },

      {
          "type": "input",
          "label": "阅读次数",
          "prop": "browseNum",
          "rules": [{
              required: true,
              message: '阅读次数不能为空',
              trigger: 'blur'
          }],
          display:false,
          "span": 12
      }

      ,

      {
          hide: true,
          label: '图片',
          prop: 'photo',
          type: 'upload',
          // dataType: 'string',
          // listType: 'picture-card',
          // propsHttp: {
          //     url: 'url',
          //     name: 'name',
          //     res: 'data.data'
          // },

          listType: 'picture-img',
          propsHttp: {
              url: 'url',
              name: 'name',
              res: 'data.data'
          },
          limit: 1,
          loadText: '图片上传中，请稍等',
          span: 24,
          canvasOption: {
              text: 'xjAAAAAAAAAAAAA',
              ratio: 0.1,
          },
          accept:'image/png, image/jpeg',
          // cropperOption: {
          //     autoCropWidth:100,
          //     autoCropHeight:100,
          //     fixed:true,
          //     fixedNumber:[100,100],
          // },
          tip: '只能上传jpg/png文件，且不超过500kb',
          action:  website.baseUrl+"/api/sys/file/upload"
      },


      {
          "type": "ueditor",
          // 指定插件类型为在线编辑器
          "component": 'avueUeditor',
          "label": "内容",
          "prop": "content",
          "minWidth": "200px",
          "span": 24,
          hide:true,
          // 上传路径
          action: website.baseUrl + "/api/sys/file/upload",
          "data": {
              // 额外参数
              // "name": "file",
          },
          "propsHttp": {
              // 上传完成返回的json的root
              "res": "data.data",
              // 上传完成返回的图片路径
              "url": "url",
              // 上传文件名，默认file
              "fileName": "file",
          },
          "customConfig": {
              // "uploadFileName": "file",
              // "name": "file",
              // 写wangEditor.config中的配置项，例如下面所示excludeMenus、menus官网建议只写其中一个
              // showMenuTooltips: false
              // "excludeMenus": ['video']
              // menus: [
              //   'bold',
              //   'head',
              //   'link',
              //   'italic',
              //   'underline'
              // ]
          },
          "overHidden": true
      }


  ]
}
